#include<bits/stdc++.h>
using namespace std;
#define int long long

char ch[25][25];

int cnt[25][25][5][2];	// l, tl, t, tr

int dx[] = {0, -1, -1, -1};
int dy[] = {-1, -1, 0, 1};

bool check() {
	int cnt1, cnt2;
	cnt1 = cnt2 = 0;

	for (int i = 1; i < 21; i++) {
		for (int j = 1; j < 21; j++) {
			if (ch[i][j] == 'o') {
				cnt1++;

				for (int k = 0; k < 4; k++) {
					cnt[i][j][k][0] = cnt[i + dx[k]][j + dy[k]][k][0] + 1;
				}
			}
			if (ch[i][j] == 'x') {
				cnt2++;

				for (int k = 0; k < 4; k++) {
					cnt[i][j][k][1] = cnt[i + dx[k]][j + dy[k]][k][1] + 1;
				}
			}
		}
	}
	if (abs(cnt1 - cnt2) > 1)
		return false;


	for (int i = 1; i < 21; i++)
		for (int j = 1; j < 21; j++)
			for (int k = 0; k < 4; k++)
				for (int l = 0; l < 2; l++)
					if (cnt[i][j][k][l] >= 5)
						return false;

	return true;
}

signed main() {
//	system("start https://www.lanqiao.cn/problems/3901/learning/");

	for (int i = 1; i < 21; i++)
		for (int j = 1; j < 21; j++)
			cin >> ch[i][j];

	cout << (check() ? "Yes" : "No");

	return 0;
}
